package com.example.tests;


import org.testng.annotations.Test;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;

import com.example.fw.GroupObject;
import com.example.fw.Groups;

public class GroupEditionTests extends TestBase {
	@Test
	public void testFirstGroupCanBeEdited() throws Exception {
		GroupObject validGroup = new GroupObject().setName("rytwuytuwe")
				.setHeader("54646").setFooter("4564564");
		Groups oldList = app.getGroupHelper().getGroups();
		GroupObject groupBefore = app.getGroupHelper().getFirstGroup();
		app.getGroupHelper().editGroup(0, validGroup);
		Groups newList = app.getGroupHelper().getGroups();
		assertThat(newList, equalTo(oldList.withRemoved(groupBefore).withAdded(validGroup)));
	}
}